From: cl349@firebug.cl.cam.ac.uk Date: Tue, 13 Sep 2005 19:43:58 +0000 (+0000) Subject: Free blkif if vbd_create fails. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16806^2~29 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=99e3e3dc2cdf244f3b51166efc425d392d6e3a73;p=xen.git Free blkif if vbd_create fails. Signed-off-by: Christian Limpach --- diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c index bf9817a8f0..c081aa8240 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c @@ -170,7 +170,6 @@ static void backend_changed(struct xenbus_watch *watch, const char *node) be->blkif = alloc_blkif(be->frontend_id); if (IS_ERR(be->blkif)) { - /* XXX SMH: should free blkif here... hmm */ err = PTR_ERR(be->blkif); be->blkif = NULL; xenbus_dev_error(dev, err, "creating block interface"); @@ -179,8 +178,8 @@ static void backend_changed(struct xenbus_watch *watch, const char *node) err = vbd_create(be->blkif, handle, be->pdev, be->readonly); if (err) { - /* XXX SMH: should free blkif here too... */ - be->blkif = NULL; + blkif_put(be->blkif); + be->blkif = NULL; xenbus_dev_error(dev, err, "creating vbd structure"); return; }